import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime'

dayjs.extend(relativeTime)

export const formatTimeAgo = (date: string | Date) => {
  return dayjs(date).locale('zh-cn').fromNow()
}
